<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<style type="text/css">
		*{
			margin:0;
			padding: 0;
		}
		body{
			background: #ccc;
			/*opacity: 0.5;*/
		}
		header{
			width: 100%;height: 50px;
		}
		#wrap{
			width: 300px;
			height: 200px;
			background: black;
			margin:150px auto;
		}
		#wrap p{
			color: white;
			line-height: 80px;
			margin-left: 30px;
		}
		button{
			background-color: white;
		}
	</style>
</head>
<body>
<header>
	<button id="dl">登陆</button><button id="zc">注册</button>
</header>
	<div id="wrap">
		<p>用户名:<input type="text" name=""></p>
		<p>密&nbsp;码:<input type="password" name=""></p>
		
	</div>
</body>
<script type="text/javascript" src="jquery-3.0.0.min.js"></script>
<script type="text/javascript">
	$("#zc").on("click",function(){
		var a1={
			username:$("input").eq(0).val(),
			password:$("input").eq(1).val()
		}
		$.ajax({
			url:"http://localhost:2403/user",
			type:"post",
			data:a1,
			success:function(data){
				console.log(data);
				alert("成功了");
				$("#zc").css("display","none");
			}
		})

	})
	$("#dl").on("click",function(){
		var a2={
			username:$("input").eq(0).val(),
			password:$("input").eq(1).val()
		}
		$.ajax({
			url:"http://localhost:2403/user/login",
			type:"post",
			data:a2,
			success:function(data){
				// console.log(data);
				window.open("后台系统.html");
			},
			error:function(err){
				alert("请重新输入，认真点小赤佬！")
			}
		})
	})
</script>
</html>